<?php

class DefaultController extends AdminController
{
	
	public function actionIndex()
	{
		
		$this->render('index');
	}
	
	/**
	 * 出错处理
	 */
	public function actionError()
	{
	
		if($error=Yii::app()->errorHandler->error)
		{
			if(Yii::app()->request->isAjaxRequest)
				echo $error['message'];
			else {
				if ($error['code']==404) {
					$this->redirect(array('default/index'));
				}
				else {
					$this->render('error', $error);
				}
			}
		}
	}
}
